using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;

public class JoyPlayerControll : MonoBehaviour
{
    public MyJoyStick myJoyStick;
    private float speed = 5;
    private NavMeshAgent agent;

    // Start is called before the first frame update
    void Start()
    {
        agent = GetComponent<NavMeshAgent>();
    }

    // Update is called once per frame
    void Update()
    {
        agent.destination = transform.position + (new Vector3(myJoyStick.input.x, 0, myJoyStick.input.y) * Time.deltaTime * speed);

        // transform.Translate(new Vector3(myJoyStick.input.x, 0, myJoyStick.input.y) * Time.deltaTime * speed, Space.World);
    }
}
